package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum InsuredTypeEnum {
    ONSHORE("1", "在案"),
    OFFSHORE("2", "离案");

    private final String code;
    private final String description;

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 根据code获取描述
    public static String getDescriptionByCode(String code) {
        for (InsuredTypeEnum type : InsuredTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type.getDescription();
            }
        }
        return null;
    }
}
